package com.gxa.admin.controller;

import com.gxa.common.vo.JsonResult;
import com.gxa.common.vo.PageRecv;
import com.gxa.modules.pojo.Overdue;
import com.gxa.modules.service.OverdueService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Api(value = "逾期处理接口",tags = "逾期接口API")
@Controller
@RequestMapping("/overdue")
public class OverdueController {
    @Autowired
    private OverdueService overdueService;

    @GetMapping("/queryOverdue")
    @ResponseBody
    @ApiOperation(value = "逾期查询接口",notes = "查询逾期",httpMethod = "GET", response = JsonResult.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
   //@RequiresPermissions("home/overduto")
    public JsonResult queryOverdue(Integer page, Integer limit){
        return overdueService.queryOverdue(page,limit);
    }


    @PostMapping("/searchOverdue")
    @ResponseBody
    @ApiOperation(value = "逾期搜索接口",notes = "搜索逾期",httpMethod = "POST", response = JsonResult.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public JsonResult searchOverdueList( @RequestBody PageRecv<Overdue>pageRecv){
        System.out.println(pageRecv);
        return overdueService.searchOverdueList(pageRecv);
    }
}
